import { request } from '@/utils/request';
import CRUD from '@/utils/request/CRUD';

// 文件CRUD
export const fileCRUD = CRUD('/infra/file');

// 获取文件预签名地址
export function getFilePresignedUrl(path: string) {
  return request.get({
    url: '/infra/file/presigned-url',
    params: { path }
  });
}
// 上传文件
export const updateFile = (data: any) => {
  return request.upload({ url: '/infra/file/upload', data })
}

